Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable default access logger and utilize log4j2 for http access logs #2185

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

arunans23
Copy link
Member

Resolves to wso2/micro-integrator#3281

Currently, HTTP Access logs use a custom implementation to write the logs to the file. This has a request and response queue to hold the logs and write them to the file using a Timer task. In a high-traffic scenario, this becomes a bottleneck because the Heap memory easily fills up because of the logs added to the queuea.

This commit disables the current implementation and utilizes log4j2 to write the access logs to the file system which is more efficient. Also, timer tasks are removed and LinkedBlockingQueue is used to handle logs asynchronously in a timely manner.

Related to wso2/product-micro-integrator#3281
Currently, HTTP Access logs use a custom implementation to write the logs to the file. This has a request and response queue to hold the logs and write them to the file using a Timer task. In a high-traffic scenario, this becomes a bottleneck because the Heap memory easily fills up because of the logs added to the queuea.

This commit disables the current implementation and utilizes log4j2 to write the access logs to the file system which is more efficient. Also, timer tasks are removed and LinkedBlockingQueue is used to handle logs asynchronously in a timely manner.
@SanojPunchihewa
Copy link
Contributor

Since the current implementation is no longer used, Shall we remove those codes?

@arunans23
Copy link
Member Author

Since the current implementation is no longer used, Shall we remove those codes?

I kept the existing code as it is, incase there are users who want to publish to custom files as before. Also, APIM product might also utilize the existing behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants